export interface IFiles {
  [propName: string]: string,
}

export default function modules(): IFiles {
  const modulesFiles = require.context("@/store/types", true, /\.js|.ts$/);
  return modulesFiles.keys().reduce((cur: IFiles, pre: string) => {
    const moduleName: string = pre.replace(/^\.\/(.*)\.\w+$/, '$1');
    const content = modulesFiles(pre);
    cur[moduleName] = content.default;
    return cur;
}, {});
}